package com.project.myPackage.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.project.myPackage.entity.Orderdetails;
import com.project.myPackage.mapper.OrderdetailsMapper;
import com.project.myPackage.service.OrderdetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Service
public class OrderdetailsServiceImpl extends ServiceImpl<OrderdetailsMapper, Orderdetails> implements OrderdetailsService {
 @Autowired
 private OrderdetailsMapper orderdetailsMapper;
   public List<Map<String, Object>> getAllOrderdetailsByOrderId(Integer order_id){
       return orderdetailsMapper.getAllOrderdetailsByOrderId(order_id);
    }
  @Transactional
   public List<Map<String, Object>>  getTotalCategoryMoney(String start_time, String end_time){
        return orderdetailsMapper.getTotalCategoryMoney(start_time,end_time);
    }

   public List<Map<String, Object>> getTotalMoneyByOrderDate(String start_time, String end_time){
        return orderdetailsMapper.getTotalMoneyByOrderDate(start_time,end_time);
    }
}
